import com.xuan.entity.Student;
import com.xuan.service.IStudentService;
import com.xuan.testtempel.SpringBootTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@SpringBootTest
    public class TestMp {
        @Autowired
        private IStudentService studentService;

        @Test
        public void testone() {
            List<Student> list = studentService.list();
            list.forEach(System.out::println);
        }

        @Test
        public void testtwo() {
            Student student = new Student();
            student.setSname("房挥冯");
            student.setSex("男");
            student.setAge(66);
            student.setAddr("江西抚州");
            student.setCid(1);
            studentService.save(student);

        }
        @Test
        public void testthree() {
            Integer sid = 6;
            Student student = studentService.getById(sid);
            student.setSname("房挥冯");
            student.setAddr("南昌红谷滩区");
            studentService.updateById(student);

        }
    }

